<?php include("/includes/header.php") ?>
<?php include("/includes/sidebar.php") ?>
<?php $id = base64_decode($_GET[trim(base64_encode("idroom"), '=')]); ?>

<?php
	$paidStatus = array(0 => "Occupier", 1 => "Checkout");
	$data_room = getRoom($id);
	$sql = "SELECT * FROM front_office WHERE idroom = '".$id."' ORDER BY Checkin";
	$query = mysql_query($sql);
?>

<div class="header">
	<span>
		<a href="fo-room-info.php?<?php echo $_SERVER["QUERY_STRING"]; ?>">
			<i class="fa fa-eye"></i> Room Info
		</a>
	</span>
	<span>
		<a href="fo-room-activity-table.php?<?php echo $_SERVER["QUERY_STRING"]; ?>">
			<i class="fa fa-table"></i> Table View
		</a>
	</span>
	<span class="active">
		<a href="fo-room-activity-calendar.php?<?php echo $_SERVER["QUERY_STRING"]; ?>">
			<i class="fa fa-calendar"></i> Calendar View
		</a>
	</span>
	<span>
		<a href="fo-room-activity-graph.php?<?php echo $_SERVER["QUERY_STRING"]; ?>">
			<i class="fa fa-bar-chart-o"></i> Graph View
		</a>
	</span>
</div>

<div class="content row-fluid"> 
	<div class="span12 table-placer">
		<div class="alert alert-info"><h4>Room Activity - <?php echo $data_room["nama"]; ?> | <small>Calendar View</small></h4></div>
		<div class="row-fluid index-pos-placer content">
			<div id='calendar'></div>
		</div>
	</div>           
</div>

<div class="footer">
</div>

<?php include("/includes/footer.php") ?>   

<script type="text/javascript">
	$(document).ready(function() {
		$('#calendar').fullCalendar({
		
			editable: true,
			
			events: "ajax/json_guest_calendar.php?<?php echo trim(base64_encode("idroom"), '=')."=".base64_encode($id); ?>",
			
			eventDrop: function(event, delta) {
				alert(event.title + ' was moved ' + delta + ' days\n' +
					'(should probably update your database)');
			},
			
			loading: function(bool) {
				if (bool) $('#loading').show();
				else $('#loading').hide();
			},
			eventColor: '#ba89b6'
			
		});
	});
</script>        